package br.usp.icmc.biomac.client.place;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;

/**
 * @author dilvan
 *In order to be accessible via a URL, an Activity needs a corresponding Place.
 *A Place extends com.google.gwt.app.place.Place and must have an associated PlaceTokenizer which
 *knows how to serialize the Place's state to a URL token. By default, the URL consists of the 
 *Place's simple class name (like "HelloPlace") followed by a colon (:) and the token returned by the PlaceTokenizer.
 */
public class ImageListPlace extends Place {
    private String token;

    public ImageListPlace(String token) {
        this.token = token;
    }

    public String getToken() {
        return token;
    }

    public static class Tokenizer implements PlaceTokenizer<ImageListPlace> {
        @Override
        public String getToken(ImageListPlace place) {
            return place.getToken();
        }

        @Override
        public ImageListPlace getPlace(String token) {
            return new ImageListPlace(token);
        }
    }
}